<?php
namespace app\index\controller;
use think\Controller;


/*
*    搜索
 */
class Search extends Controller
{
    public function index()
    {
    	// 搜索帖子查询
        $sousuo = input('post.')['search'];
        
        $note = db('note')->where('title', 'like', '%'.$sousuo.'%')->select();
        foreach ($note as &$val) {
            $val['name'] = db('information')->where('userid', $val['uid'])->find()['name'];
            $val['time'] = date('y-m-d h:i',$val['time']);
        }
        // var_dump($note);die;
        $this->assign("title",'搜索');
        $this->assign("note",$note);

        return $this->fetch();
    }
}
